//#define _CRT_SECURE_NO_WARNINGS 1
//
////class Solution {
////public:
////    int evalRPN(vector<string>& tokens) {
////        stack<int> st;
////        for (auto& str : tokens)
////        {
////            if (str == "+" || str == "-" || str == "*" || str == "/")
////            {
////                int right = st.top();
////                st.pop();
////                int left = st.top();
////                st.pop();
////                switch (str[0])
////                {
////                case '+':
////                    st.push(left + right);
////                    break;
////                case '-':
////                    st.push(left - right);
////                    break;
////                case '*':
////                    st.push(left * right);
////                    break;
////                case '/':
////                    st.push(left / right);
////                    break;
////                }
////            }
////            else
////            {
////                st.push(stoi(str));
////            }
////        }
////        return st.top();
////    }
////};
//
//class Solution {
//public:
//    int findKthLargest(vector<int>& nums, int k) {
//        priority_queue<int, vector<int>, less<int>> pq;
//        for (auto x : nums)
//            pq.push(x);
//        for (int i = 0; i < k - 1; ++i)
//            pq.pop();
//        return pq.top();
//    }
//};

#include <stdlib.h>
#include <iostream>
using namespace std;

void bubblesorf(int* arr, int len)
{
    for (int i = 0; i < len - 1; i++)
    {
        for (int j = 0; j < len - i - 1; j++)
        {
            if (arr[j] > arr[j + 1])
            {
                int temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
            }
        }
    }
}
// oid printarray(int* arr, int len) {
	//
	//}

	int main() {
		int arr[10] = { 4,3,6,9,1,2,10,8,7,5 };
		int len = sizeof(arr) / sizeof(arr[0]);
		bubblesorf(arr, len);


		return 0;
	}
